﻿<html lang="zh-CN">
<head>
    {% load bootstrap4 %}
    {% bootstrap_css %}
    {% bootstrap_javascript %}
    <title>自动化测试平台</title>
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">
    <!--<link rel="stylesheet" type="text/css" href="/static/admin/css/base.css" />
      -->
    <link rel="stylesheet" type="text/css" href="/static/admin/css/forms.css"/>

    <script type="text/javascript" src="/admin/jsi18n/"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/jquery/jquery.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript" src="/static/admin/js/actions.js"></script>
    <script type="text/javascript" src="/static/admin/js/urlify.js"></script>
    <script type="text/javascript" src="/static/admin/js/prepopulate.js"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/xregexp/xregexp.js"></script>

    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/responsive.css"/>
    <meta name="robots" content="NONE,NOARCHIVE"/>

</head>
<body role="document">
<!-- 导航栏-->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
    <div class="container">
        <li class="active"><a style='color:white' href="/apis_manage/">单一接口</a></li>
        <li><a style='color:white' href="/apitest_manage/">流程接口</a></li>
        <li class="active"><a style='color:white' href="/appcase_manage/">app用例</a></li>
        <li class="active"><a style='color:white' href="/webcase_manage/">web用例</a></li>
        <ul class="nav justify-content-center">
        </ul>
        <ul class="nav justify-content-end" style="position:absolute; right:10px; bottom:0px; ">
            <li class="nav-link"><a style='color:white' href="#">{{ user }}</a></li>
            <li class="nav-link"><a style='color:white' href="/logout/">退出</a></li>
        </ul>
    </div>
</nav>
<!-- 搜索栏-->
<div class="page-header" style="padding-top:0px">
    <form class="navbar-form" method="get" action="/appsearch/">

        {% csrf_token %}
        <input type="search" name="appcasename" placeholder="名称" required>

        <button type="submit">搜索</button>


        <!-- 增加app测试用例-->
        <div style="float:right;width:20%">
{#            <select name="Appcase" id="id_Appcase">#}
{#                <option value="" selected>------app测试用例------</option>#}
{#            </select>#}
{#            <a class="related-widget-wrapper-link change-related" id="change_id_Appcase"#}
{#               data-href-template="/admin/apptest/appcase/__fk__/change/?_to_field=id&amp;_popup=1" title="更改选中的测试用例">#}
{#                <img src="/static/admin/img/icon-changelink.svg" alt="修改"/>#}
{#            </a>#}
            <a style="color:#0068ff" class="related-widget-wrapper-link add-related" id="add_id_Appcase"
               href="/admin/apptest/appcase/add/?_to_field=id&amp;_popup=1" title="增加新测试用例">
                <img src="/static/admin/img/icon-addlink.svg" alt="增加"/>增加
            </a>
        </div>
    </form>
</div>

<!-- 流程接口列表-->
<div class="row" style="padding-top:20px;width:100%">
    <div class="col-md-12">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>ID</th>
                <th>产品</th>
                <th>用例名称</th>
                <th>结果</th>
                <th>负责人</th>
                <th>时间</th>
                <th>查看</th>
                <th>编辑</th>
                <th>删除</th>
            </tr>
            </thead>
            <tbody>
            {% for appcase in appcases %}
                <tr>
                    <td>{{ appcase.id }}</td>
                    <td>{{ appcase.Product.productname }}</td>
                    <td>{{ appcase.appcasename }}</td>
                    <td>{{ appcase.apptestresult }}</td>
                    <td>{{ appcase.apptester }}</td>
                    <td>{{ appcase.create_time }}</td>
                    <td><a href="{% url "appcasestep_manage" %}?appcase.id={{ appcase.id }} "><img
                            src="/static/admin/img/icon-yes.svg"/></a></td>
                    <td><a style="color:#0068ff" class="related-widget-wrapper-link add-related" id="add_id_Appcase"
                           href="../admin/apptest/appcase/{{ appcase.id }}/change/?_to_field=id&_popup=1"><img
                            src="/static/admin/img/icon-changelink.svg"/></a></td>
                    <td><a style="color:#0068ff" class="related-widget-wrapper-link add-related" id="add_id_Appcase"
                           href="../admin/apptest/appcase/{{ appcase.id }}/delete/?_to_field=id&_popup=1"><img
                            src="/static/admin/img/icon-deletelink.svg"/></a></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>

<!--统计和翻页功能-->
<span style="position:absolute; left:600px; bottom:30px;">   {# 把翻页功能固定显示在右下角#}
<div  class="container-fluid margin_bottom_5 margin_top_5 clear_padding text-center" style="position:absolute; width:120px;">
共:{{ appcasecounts }}条记录 {# 前端读取定义的变量#}
</div>

<div class="container">
    <ul class="pagination" id="pager">
          {# 上一页链接开始#}
        {% if appcases.has_previous %}
            {#  如果有上一页则正常显示上一页链接#}
            <li class="previous"><a href="/appcase_manage/?page={{ appcases.previous_page_number }}">上一页</a></li>
            {#  上一页标签 #}
        {% else %}
            <li class="previous disabled"><a href="#">上一页</a></li> {# 如果当前不存在上一页则上一页的链接不可点击#}
        {% endif %}
        {# 上一页链接开始#}

        {% for num in appcases.paginator.page_range %}

            {% if num == currentPage %}
                <li class="item active"><a href="/appcase_manage/?page={{ num }}">{{ num }}</a></li> {#显示当页数链接#}
            {% else %}
                <li class="item"><a href="/appcase_manage/?page={{ num }}">{{ num }}</a></li>
            {% endif %}
        {% endfor %}

        {# 下一页链接开始#}
        {% if appcases.has_next %} {#  如果有下一页则正常显示下一页链接#}
            <li class="next"><a href="/appcase_manage/?page={{ appcases.next_page_number }}">下一页</a></li>
        {% else %}
            <li class="next disabled"><a href="#">下一页</a></li>
        {% endif %}
        {# 下一页链接结束#}
    </ul>
</div>

<script type="text/javascript"
        id="django-admin-form-add-constants"
        src="/static/admin/js/change_form.js"
        data-model-name="appcase">
</script>

<script type="text/javascript"
        id="django-admin-prepopulated-fields-constants"
        src="/static/admin/js/prepopulate_init.js"
        data-prepopulated-fields="[]">
</script>
</span>
</body>
</html>
